<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2016/8/9 0009
 * Time: 13:53
 * 派单员级别代码表
 */
    namespace Common\Model;
    use Common\Model\CommonModel;
    class DispatchLevelModel extends CommonModel{

         protected $_validate = array(
            //array(验证字段,验证规则,错误提示,验证条件,附加规则,验证时间)
            array('level_name', 'require', '级别名称名称不能为空！', 1, 'regex', CommonModel:: MODEL_INSERT  ),
            array('lowest_growth_value', 'require', '最低成长值数不能为空！', 1, 'regex', CommonModel:: MODEL_INSERT ),
            array('serv_charge_rate', 'require', '提取服务费比例不能为空！', 1, 'regex', CommonModel:: MODEL_UPDATE  ),
            array('level_img', 'require', '级别图标不能为空！', 1, 'regex', CommonModel:: MODEL_UPDATE  ),

        );


        public function get_serv_charge_rate($dispatch_level_id){
            $ret = $this->where(array('dispatch_level_id'=>$dispatch_level_id))->field('serv_charge_rate')->find();
            return $ret['serv_charge_rate'];
        }
    }